package chapter6.section1;

//程序6-1b：通过继承创建的一个新的子类型CreditAccount
public class CreditAccount extends Account {
	private int limit;// 信用卡限额

	public CreditAccount(String id, String name, int balance, int limit) {
		super(id, name, balance);
		this.limit = limit;
	}

	// 调整信用卡用户的限额
	public void adjustLimit(int limit) {
		this.limit = limit;
	}

	public static void main(String[] args) {
		// 创建一个信用额度为5000元的信用卡账户对象
		CreditAccount ca = new CreditAccount("001", "鲁宁", 10000, 5000);
		ca.withdraw(1000);
		System.out.println("当前余额：" + ca.getBalance());
	}
}
